<template>
  <el-form label-width="90px" size="mini">
    <el-form-item label="图片">
      <tm-img-pick v-model="attribute.src"/>
    </el-form-item>
    <el-form-item label="填充方式">
      <tm-select v-model="attribute.fit" :data="fitList"></tm-select>
    </el-form-item>
    <el-form-item label="背景色">
      <tm-color-range v-model="attribute.bgColor" />
    </el-form-item>
  </el-form>
</template>

<script>
import tmImgPick from "@/package/components/tm-img-pick";
import tmSelect from "@/package/components/tm-select";
import tmColorRange from "@/package/components/tm-color-range";

export default {
  name: 'widget-image-option',
  cnName: 'widget-image-option',
  components: {tmImgPick, tmSelect, tmColorRange},
  props: {
    attribute: Object
  },
  data() {
    return {
      fitList: [
        {label: 'fill', value: 'fill'},
        {label: 'contain', value: 'contain'},
        {label: 'cover', value: 'cover'},
        {label: 'none', value: 'none'},
        {label: 'scale-down', value: 'scale-down'}
      ]
    }
  },
  methods: {}
}
</script>

<style lang="less" scoped>

</style>
